﻿
/*----------------------------------------------------------------//
// 文件名：MoTestCatalog.cs
// 文件功能描述：实体 MoTestCatalog.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTestCatalog
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoTestCatalog
    /// </summary>
    public partial class MoTestCatalog : ICloneable
    {
        #region 表TestCatalog的字段
        private string testCtgId;
        private string parentCtgId;
        private string testCtgName;
        private string rem;
        private DateTime createTime;
        private DateTime updateTime;
        private string tcFlag;
        #endregion

        #region 构造函数
        public MoTestCatalog()
        {
            createTime = new DateTime(1900, 1, 1); updateTime = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoTestCatalog(MoTestCatalog item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoTestCatalog(string testCtgId, string parentCtgId, string testCtgName, string rem, DateTime createTime, DateTime updateTime, string tcFlag)
        {
            this.testCtgId = testCtgId;
            this.parentCtgId = parentCtgId;
            this.testCtgName = testCtgName;
            this.rem = rem;
            this.createTime = createTime;
            this.updateTime = updateTime;
            this.tcFlag = tcFlag;
        }
        #endregion

        #region 表TestCatalog的字段属性
        /// <summary>
        /// TEST_CTG_ID
        /// </summary>
        public string TestCtgId
        {
            get { return testCtgId; }
            set { testCtgId = value; }
        }
        /// <summary>
        /// PARENT_CTG_ID
        /// </summary>
        public string ParentCtgId
        {
            get { return parentCtgId; }
            set { parentCtgId = value; }
        }
        /// <summary>
        /// TEST_CTG_NAME
        /// </summary>
        public string TestCtgName
        {
            get { return testCtgName; }
            set { testCtgName = value; }
        }
        /// <summary>
        /// REM
        /// </summary>
        public string Rem
        {
            get { return rem; }
            set { rem = value; }
        }
        /// <summary>
        /// CREATE_TIME
        /// </summary>
        public DateTime CreateTime
        {
            get { return createTime; }
            set { createTime = value; }
        }
        /// <summary>
        /// UPDATE_TIME
        /// </summary>
        public DateTime UpdateTime
        {
            get { return updateTime; }
            set { updateTime = value; }
        }
        /// <summary>
        /// TC_FLAG
        /// </summary>
        public string TcFlag
        {
            get { return tcFlag; }
            set { tcFlag = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoTestCatalog CopyTo(MoTestCatalog item)
        {
            item.testCtgId = this.testCtgId;
            item.parentCtgId = this.parentCtgId;
            item.testCtgName = this.testCtgName;
            item.rem = this.rem;
            item.createTime = this.createTime;
            item.updateTime = this.updateTime;
            item.tcFlag = this.tcFlag;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoTestCatalog mo = new MoTestCatalog();
            mo.TestCtgId = this.TestCtgId;
            mo.ParentCtgId = this.ParentCtgId;
            mo.TestCtgName = this.TestCtgName;
            mo.Rem = this.Rem;
            mo.CreateTime = this.CreateTime;
            mo.UpdateTime = this.UpdateTime;
            mo.TcFlag = this.TcFlag;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoTestCatalog NewTestCatalog = obj as MoTestCatalog;
                if (NewTestCatalog == null)
                {
                    return false;
                }
                else
                {
                    if (NewTestCatalog.TestCtgId == this.TestCtgId && NewTestCatalog.ParentCtgId == this.ParentCtgId && NewTestCatalog.TestCtgName == this.TestCtgName && NewTestCatalog.Rem == this.Rem && NewTestCatalog.CreateTime == this.CreateTime && NewTestCatalog.UpdateTime == this.UpdateTime && NewTestCatalog.TcFlag == this.TcFlag)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "TestCtgId={0}/ParentCtgId={1}/TestCtgName={2}/Rem={3}/CreateTime={4}/UpdateTime={5}/TcFlag={6}", testCtgId, parentCtgId, testCtgName, rem, createTime, updateTime, tcFlag);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["Test_Ctg_ID"] != null && row["Test_Ctg_ID"] != DBNull.Value)
            {
                this.TestCtgId = (string)row["Test_Ctg_ID"];
            }
            else
            {
                this.TestCtgId = string.Empty;
            }
            if (row["Parent_Ctg_ID"] != null && row["Parent_Ctg_ID"] != DBNull.Value)
            {
                this.ParentCtgId = (string)row["Parent_Ctg_ID"];
            }
            else
            {
                this.ParentCtgId = string.Empty;
            }
            if (row["Test_Ctg_Name"] != null && row["Test_Ctg_Name"] != DBNull.Value)
            {
                this.TestCtgName = (string)row["Test_Ctg_Name"];
            }
            else
            {
                this.TestCtgName = string.Empty;
            }
            if (row["Rem"] != null && row["Rem"] != DBNull.Value)
            {
                this.Rem = (string)row["Rem"];
            }
            else
            {
                this.Rem = string.Empty;
            }
            if (row["Create_Time"] != null && row["Create_Time"] != DBNull.Value)
            {
                this.CreateTime = (DateTime)row["Create_Time"];
            }
            else
            {
                this.CreateTime = DateTime.MinValue;
            }
            if (row["Update_Time"] != null && row["Update_Time"] != DBNull.Value)
            {
                this.UpdateTime = (DateTime)row["Update_Time"];
            }
            else
            {
                this.UpdateTime = DateTime.MinValue;
            }
            if (row["TC_Flag"] != null && row["TC_Flag"] != DBNull.Value)
            {
                this.TcFlag = (string)row["TC_Flag"];
            }
            else
            {
                this.TcFlag = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["Test_Ctg_ID"] = this.TestCtgId;
            row["Parent_Ctg_ID"] = this.ParentCtgId;
            row["Test_Ctg_Name"] = this.TestCtgName;
            row["Rem"] = this.Rem;
            row["Create_Time"] = this.CreateTime;
            row["Update_Time"] = this.UpdateTime;
            row["TC_Flag"] = this.TcFlag;
        }
        #endregion
    }
}
#endregion
